// pages/paysuc/paysuc.js

const app = getApp()
const pathUrl = app.globalData.pathUrl;
Page({

  /**
   * 页面的初始数据
   */
  data: {

  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (e) {
    var that = this;
    var openId = wx.getStorageSync("openId")
    var telphone = wx.getStorageSync("telphone")
    var orderNo = wx.getStorageSync("orderNo")
    var loginInfo = wx.getStorageSync("loginInfo")
    var loginInfo = JSON.parse(loginInfo)
    console.log(loginInfo)
    var name = loginInfo.records[0].query13
    that.setData({
      openId: openId,
      telphone: telphone,
      orderNo: orderNo,
      name: name
    })
    this.getmoney();
  },
  getmoney: function (e) {
    var that = this;
    wx.request({
      url: pathUrl + '/gzgl/fxyGzgl06/list',
      method: 'GET',
      data: {
        query07: that.data.orderNo,
      },
      success: function (res) {
        console.log(res.data.result.records[0].query12);
        var list = res.data.result.records[0];
        that.setData({
          money: list.query12
        })
      },
      fail: function (res) { }
    });
  },
  // 订单查询
  viewOrder: function() {
    wx.switchTab({
      url: '/pages/index/index',
    })
  },



  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})